import useRequest from "@/api/useRequest";

export class fileController {

  /**
   * 获取回收站文件列表
   */
  static getRecoveryFile(): Promise<any> {
    return useRequest({
      url: "/recoveryfile/list",
      method: "get"
    })
  }

  static getFileListByPath(data: any): Promise<any> {
    return useRequest({
      url: "/file/getfilelist",
      method: "post",
      data
    })
  }

  static getStorage(): Promise<any> {
    return useRequest({
      url: "/filetransfer/getstorage",
      method: "get"
    })
  }

  static createFold(data: any): Promise<any> {
    return useRequest({
      url: "/file/createFold",
      method: "post",
      data
    })
  }

  static batchDeleteFile(data: any): Promise<any> {
    return useRequest({
      url: "/file/batchdeletefile",
      method: "post",
      data
    })
  }

  static batchDeleteRecoveryFile(data: any): Promise<any> {
    return useRequest({
      url: "/recoveryfile/batchdelete",
      method: "post",
      data
    })
  }


  static deleteFile(data: any): Promise<any> {
    return useRequest({
      url: "/file/deletefile",
      method: "post",
      data
    })
  }


  static deleteRecoveryFile(data: any): Promise<any> {
    return useRequest({
      url: "/recoveryfile/deleterecoveryfile",
      method: "post",
      data
    })
  }


  static getFileDetail(data: any): Promise<any> {
    return useRequest({
      url: "/file/detail",
      method: "post",
      data
    })
  }


  static getFoldTree(): Promise<any> {
    return useRequest({
      url: "/file/getfiletree",
      method: "get"
    })
  }


  static copyFile(data: any): Promise<any> {
    return useRequest({
      url: "/file/copyfile",
      method: "post",
      data
    })
  }


  static batchMoveFile(data:any): Promise<any>{
    return useRequest({
      url: "/file/batchmovefile",
      method: "post",
      data
    })
  }


  static moveFile(data: any): Promise<any> {
    return useRequest({
      url: "/file/movefile",
      method: "post",
      data
    })
  }

  static renameFile(data: any): Promise<any> {
    return useRequest({
      url: "/file/renamefile",
      method: "post",
      data
    })
  }

  static getFileBase64(token:string,userFileId:string): Promise<any> {
    return useRequest({
      url: "/filetransfer/getFileBase64?token="+token+"&userFileId="+userFileId,
      method: "get"
    })
  }

}
